<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="theme-color" content="#3367D6"/>
  <link rel="apple-touch-icon" href="/icons-192.png">
  <link rel="manifest" href="/manifest.json">

  
    <meta name="description" content="韭菜型选手">
  

  
    <meta name="keywords" content="技术,iOS">
  

  
    <meta name="author" content="Jan.">
  

  

  

  <title>SpringBoot | 勇敢的韭菜</title>

  

  
    <link rel="icon" href="/favicon.ico">
  

  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
    <link href="https://cdn.bootcss.com/highlight.js/9.15.6/styles/default.min.css" rel="stylesheet">
  

  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.1"></head>
<body>
  <div class="root-container">
    <!-- navbar -->
<nav class="navbar">
  <div class="navbar-content">
    <!-- logo -->
    <div class="navbar-logo">
      <a href="/">
        
          勇敢的韭菜
        
      </a>
    </div>
    <!-- link -->
    <div class="navbar-link">
      <div class="navbar-btn">
        <div></div>
        <div></div>
        <div></div>
      </div>
      <ul class="navbar-list">
        
          <li class="navbar-list-item"><a href="/">HOME</a></li>
        
          <li class="navbar-list-item"><a href="/about">ABOUT</a></li>
        
          <li class="navbar-list-item"><a href="/links">LINK</a></li>
        
          <li class="navbar-list-item"><a href="/tags">TAGS</a></li>
        
          <li class="navbar-list-item"><a href="/categories">CATEGORIES</a></li>
        
      </ul>
    </div>
  </div>
</nav>

    
<!-- header container -->
<header class="header-container post">

  
  

  
  

  
  

  
  

  
  
    <div class="header-content">
      <div class="post-image" style="background-image: url(https://avatars3.githubusercontent.com/u/20974631?s=400&amp;u=1b6a8ff47fc8a1219b3545aad095fd204b0fa309&amp;v=4)"></div>
      <div class="post-text">
        <div class="type-wrap">
          
        </div>
        <h1 class="title-wrap">SpringBoot</h1>
        <h2 class="title-sub-wrap">
          <strong>Jan.</strong>
          <span>发布于</span>
          
  <a href="javascript:;" class="article-date">
    <time datetime="2020-07-17T08:55:39.000Z" itemprop="datePublished">2020-07-17</time>
  </a>

        </h2>
      </div>
    </div>
  

  
  

  </header>

    <!-- 文章 -->

<!-- 文章内容 -->

<div class="body-container">
  <article class="content-container article-container">
    <div class="article-content">
      
      

      <section class="article-entry">
        <h2 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h2><blockquote>
<p><strong>这是本人学习SpringBoot过程所写的demo,学习过程以SpringBoot + MyBatis-Plus + Tomcat(SpringBoot已内置) + Swagger 2 形式写CRUD接口,由于本人是长期iOS开发一枚,也没有Spring前置知识,所以也不会过于扯这方面的知识点(只会说点注释).Java方面由于本人有Object-C、Swfit、HTML5、JS等基础,所以在code方面没什么压力.</strong></p>
</blockquote>
<h2 id="程序入口"><a href="#程序入口" class="headerlink" title="程序入口"></a>程序入口</h2><blockquote>
<p><strong>Application是运行入口,这感觉有点想类似于iOS的Application,运行Application SpringBoor内置的Tomcat也会自动运行,这样就可以测试本地接口了;ps:@SpringBootApplication这个注释作用感觉就是自动加载配置</strong></p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">package</span> com.ttuan;<br><span class="hljs-keyword">import</span> org.mybatis.spring.annotation.MapperScan;<br><span class="hljs-keyword">import</span> org.springframework.boot.SpringApplication;<br><span class="hljs-keyword">import</span> org.springframework.boot.autoconfigure.SpringBootApplication;<br><br><span class="hljs-meta">@MapperScan</span>(value = &#123;<span class="hljs-string">"com.ttuan.*"</span>&#125;)<br><span class="hljs-meta">@SpringBootApplication</span><br><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SpringbootdemoApplication</span> </span>&#123;<br><br><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>&#123;<br>SpringApplication.run(SpringbootdemoApplication<span class="hljs-class">.<span class="hljs-keyword">class</span>, <span class="hljs-title">args</span>)</span>;<br>&#125;<br><br>&#125;<br></code></pre></td></tr></table></figure>
<h2 id="项目目录"><a href="#项目目录" class="headerlink" title="项目目录"></a>项目目录</h2><p><img src="https://upload-images.jianshu.io/upload_images/2556623-ca13fc9970550572.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="a.png"></p>
<h2 id="MyBatis-Puls"><a href="#MyBatis-Puls" class="headerlink" title="MyBatis-Puls"></a>MyBatis-Puls</h2><blockquote>
<p><strong>MyBatis-Puls是MyBatis的增强工具,Mybatis是需要写大量的xml来写sql做数据库CRUD,很是麻烦。MyBatis-Puls就很好解决这个问题,它底层封装了一些CURD方法,不用再写xml,大量提高了效率</strong></p>
</blockquote>
<h2 id="接口界面"><a href="#接口界面" class="headerlink" title="接口界面"></a>接口界面</h2><p><img src="https://upload-images.jianshu.io/upload_images/2556623-37b55ac394901b3e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="b.png"></p>
<h2 id="接口文档-Swagger-2"><a href="#接口文档-Swagger-2" class="headerlink" title="接口文档 Swagger 2"></a>接口文档 Swagger 2</h2><p><strong>最紧要开心 RESTful APIs</strong></p>
<p><strong>简介</strong>：<p>可以直接调用localhost:9090/doc.html进入到接口调试界面,项目也集成了JWT Token生成</p></p>
<p><strong>HOST</strong>:localhost:9090</p>
<p><strong>联系人</strong>:Jan.</p>
<p><strong>Version</strong>:1.0</p>
<p><strong>接口路径</strong>：/v2/api-docs</p>
<h1 id="hello-controller"><a href="#hello-controller" class="headerlink" title="hello-controller"></a>hello-controller</h1><h2 id="addUser"><a href="#addUser" class="headerlink" title="addUser"></a>addUser</h2><p><strong>接口描述</strong>:</p>
<p><strong>接口地址</strong>:<code>/addUser</code></p>
<p><strong>请求方式</strong>：<code>POST</code></p>
<p><strong>consumes</strong>:<code>[&quot;application/json&quot;]</code></p>
<p><strong>produces</strong>:<code>[&quot;*/*&quot;]</code></p>
<p><strong>请求参数</strong>：</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>in</th>
<th>是否必须</th>
<th>数据类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>account</td>
<td>account</td>
<td>query</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>system OS</td>
<td>系统类型</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>token</td>
<td>登陆获取令牌</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>200响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs json">&#123;<br>    <span class="hljs-attr">"code"</span>: <span class="hljs-number">0</span>,<br>    <span class="hljs-attr">"msg"</span>: <span class="hljs-string">""</span>,<br>    <span class="hljs-attr">"request_id"</span>: <span class="hljs-string">""</span>,<br>    <span class="hljs-attr">"data"</span>: &#123;<br>        <span class="hljs-attr">"account"</span>: <span class="hljs-string">""</span>,<br>        <span class="hljs-attr">"age"</span>: <span class="hljs-number">0</span>,<br>        <span class="hljs-attr">"nickName"</span>: <span class="hljs-string">""</span>,<br>        <span class="hljs-attr">"pwd"</span>: <span class="hljs-string">""</span>,<br>        <span class="hljs-attr">"uid"</span>: <span class="hljs-string">""</span>,<br>        <span class="hljs-attr">"userHeadImg"</span>: <span class="hljs-string">""</span>,<br>        <span class="hljs-attr">"userName"</span>: <span class="hljs-string">""</span><br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<p><strong>200响应参数</strong>:</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>code</td>
<td>返回状态码；200:成功</td>
<td>integer(int32)</td>
<td>integer(int32)</td>
</tr>
<tr>
<td>msg</td>
<td>描述信息</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>request_id</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>data</td>
<td>结果数据</td>
<td>User</td>
<td>User</td>
</tr>
</tbody></table>
<p><strong>schema属性说明</strong></p>
<p><strong>User</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>account</td>
<td>账号</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>age</td>
<td>年龄</td>
<td>integer(int32)</td>
<td></td>
</tr>
<tr>
<td>nickName</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>pwd</td>
<td>密码</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>uid</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>userHeadImg</td>
<td>头像</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>userName</td>
<td>用户名</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>404响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>404响应参数</strong>:</p>
<p>暂无</p>
<p><strong>409响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>409响应参数</strong>:</p>
<p>暂无</p>
<p><strong>422响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>422响应参数</strong>:</p>
<p>暂无</p>
<p><strong>500响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>500响应参数</strong>:</p>
<p>暂无</p>
<p><strong>503响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>503响应参数</strong>:</p>
<p>暂无</p>
<p><strong>响应状态</strong>:</p>
<table>
<thead>
<tr>
<th>状态码</th>
<th>说明</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>200</td>
<td>OK</td>
<td>返回说明«User»</td>
</tr>
<tr>
<td>404</td>
<td>找不到资源</td>
<td>Responses</td>
</tr>
<tr>
<td>409</td>
<td>业务逻辑异常</td>
<td>Responses</td>
</tr>
<tr>
<td>422</td>
<td>参数校验异常</td>
<td>Responses</td>
</tr>
<tr>
<td>500</td>
<td>服务器内部错误</td>
<td>Responses</td>
</tr>
<tr>
<td>503</td>
<td>Hystrix异常</td>
<td>Responses</td>
</tr>
<tr>
<td>## deleteUserByUid</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>接口描述</strong>:</p>
<p><strong>接口地址</strong>:<code>/delete</code></p>
<p><strong>请求方式</strong>：<code>GET</code></p>
<p><strong>consumes</strong>:``</p>
<p><strong>produces</strong>:<code>[&quot;*/*&quot;]</code></p>
<p><strong>请求参数</strong>：</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>in</th>
<th>是否必须</th>
<th>数据类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>system OS</td>
<td>系统类型</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>token</td>
<td>登陆获取令牌</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>uid</td>
<td>uid</td>
<td>query</td>
<td>false</td>
<td>integer</td>
<td></td>
</tr>
</tbody></table>
<p><strong>404响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>404响应参数</strong>:</p>
<p>暂无</p>
<p><strong>409响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>409响应参数</strong>:</p>
<p>暂无</p>
<p><strong>422响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>422响应参数</strong>:</p>
<p>暂无</p>
<p><strong>500响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>500响应参数</strong>:</p>
<p>暂无</p>
<p><strong>503响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>503响应参数</strong>:</p>
<p>暂无</p>
<p><strong>响应状态</strong>:</p>
<table>
<thead>
<tr>
<th>状态码</th>
<th>说明</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>200</td>
<td>OK</td>
<td></td>
</tr>
<tr>
<td>404</td>
<td>找不到资源</td>
<td>Responses</td>
</tr>
<tr>
<td>409</td>
<td>业务逻辑异常</td>
<td>Responses</td>
</tr>
<tr>
<td>422</td>
<td>参数校验异常</td>
<td>Responses</td>
</tr>
<tr>
<td>500</td>
<td>服务器内部错误</td>
<td>Responses</td>
</tr>
<tr>
<td>503</td>
<td>Hystrix异常</td>
<td>Responses</td>
</tr>
<tr>
<td>## getAll</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>接口描述</strong>:</p>
<p><strong>接口地址</strong>:<code>/getAll</code></p>
<p><strong>请求方式</strong>：<code>GET</code></p>
<p><strong>consumes</strong>:``</p>
<p><strong>produces</strong>:<code>[&quot;*/*&quot;]</code></p>
<p><strong>请求参数</strong>：</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>in</th>
<th>是否必须</th>
<th>数据类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>system OS</td>
<td>系统类型</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>token</td>
<td>登陆获取令牌</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>200响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs json">&#123;<br>    <span class="hljs-attr">"code"</span>: <span class="hljs-number">0</span>,<br>    <span class="hljs-attr">"msg"</span>: <span class="hljs-string">""</span>,<br>    <span class="hljs-attr">"request_id"</span>: <span class="hljs-string">""</span>,<br>    <span class="hljs-attr">"data"</span>: [<br>        &#123;<br>            <span class="hljs-attr">"account"</span>: <span class="hljs-string">""</span>,<br>            <span class="hljs-attr">"age"</span>: <span class="hljs-number">0</span>,<br>            <span class="hljs-attr">"nickName"</span>: <span class="hljs-string">""</span>,<br>            <span class="hljs-attr">"pwd"</span>: <span class="hljs-string">""</span>,<br>            <span class="hljs-attr">"uid"</span>: <span class="hljs-string">""</span>,<br>            <span class="hljs-attr">"userHeadImg"</span>: <span class="hljs-string">""</span>,<br>            <span class="hljs-attr">"userName"</span>: <span class="hljs-string">""</span><br>        &#125;<br>    ]<br>&#125;<br></code></pre></td></tr></table></figure>

<p><strong>200响应参数</strong>:</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>code</td>
<td>返回状态码；200:成功</td>
<td>integer(int32)</td>
<td>integer(int32)</td>
</tr>
<tr>
<td>msg</td>
<td>描述信息</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>request_id</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>data</td>
<td>结果数据</td>
<td>array</td>
<td>User</td>
</tr>
</tbody></table>
<p><strong>schema属性说明</strong></p>
<p><strong>User</strong></p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>account</td>
<td>账号</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>age</td>
<td>年龄</td>
<td>integer(int32)</td>
<td></td>
</tr>
<tr>
<td>nickName</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>pwd</td>
<td>密码</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>uid</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>userHeadImg</td>
<td>头像</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>userName</td>
<td>用户名</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>404响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>404响应参数</strong>:</p>
<p>暂无</p>
<p><strong>409响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>409响应参数</strong>:</p>
<p>暂无</p>
<p><strong>422响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>422响应参数</strong>:</p>
<p>暂无</p>
<p><strong>500响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>500响应参数</strong>:</p>
<p>暂无</p>
<p><strong>503响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>503响应参数</strong>:</p>
<p>暂无</p>
<p><strong>响应状态</strong>:</p>
<table>
<thead>
<tr>
<th>状态码</th>
<th>说明</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>200</td>
<td>OK</td>
<td>返回说明«List«User»»</td>
</tr>
<tr>
<td>404</td>
<td>找不到资源</td>
<td>Responses</td>
</tr>
<tr>
<td>409</td>
<td>业务逻辑异常</td>
<td>Responses</td>
</tr>
<tr>
<td>422</td>
<td>参数校验异常</td>
<td>Responses</td>
</tr>
<tr>
<td>500</td>
<td>服务器内部错误</td>
<td>Responses</td>
</tr>
<tr>
<td>503</td>
<td>Hystrix异常</td>
<td>Responses</td>
</tr>
<tr>
<td>## login</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>接口描述</strong>:</p>
<p><strong>接口地址</strong>:<code>/login</code></p>
<p><strong>请求方式</strong>：<code>POST</code></p>
<p><strong>consumes</strong>:<code>[&quot;application/json&quot;]</code></p>
<p><strong>produces</strong>:<code>[&quot;*/*&quot;]</code></p>
<p><strong>请求参数</strong>：</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>in</th>
<th>是否必须</th>
<th>数据类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>account</td>
<td>account</td>
<td>query</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>pwd</td>
<td>pwd</td>
<td>query</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>system OS</td>
<td>系统类型</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>token</td>
<td>登陆获取令牌</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>200响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs json">&#123;<br>    <span class="hljs-attr">"code"</span>: <span class="hljs-number">0</span>,<br>    <span class="hljs-attr">"msg"</span>: <span class="hljs-string">""</span>,<br>    <span class="hljs-attr">"request_id"</span>: <span class="hljs-string">""</span>,<br>    <span class="hljs-attr">"data"</span>: <span class="hljs-string">""</span><br>&#125;<br></code></pre></td></tr></table></figure>

<p><strong>200响应参数</strong>:</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>code</td>
<td>返回状态码；200:成功</td>
<td>integer(int32)</td>
<td>integer(int32)</td>
</tr>
<tr>
<td>msg</td>
<td>描述信息</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>request_id</td>
<td></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>data</td>
<td>结果数据</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>404响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>404响应参数</strong>:</p>
<p>暂无</p>
<p><strong>409响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>409响应参数</strong>:</p>
<p>暂无</p>
<p><strong>422响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>422响应参数</strong>:</p>
<p>暂无</p>
<p><strong>500响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>500响应参数</strong>:</p>
<p>暂无</p>
<p><strong>503响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>503响应参数</strong>:</p>
<p>暂无</p>
<p><strong>响应状态</strong>:</p>
<table>
<thead>
<tr>
<th>状态码</th>
<th>说明</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>200</td>
<td>OK</td>
<td>返回说明«string»</td>
</tr>
<tr>
<td>404</td>
<td>找不到资源</td>
<td>Responses</td>
</tr>
<tr>
<td>409</td>
<td>业务逻辑异常</td>
<td>Responses</td>
</tr>
<tr>
<td>422</td>
<td>参数校验异常</td>
<td>Responses</td>
</tr>
<tr>
<td>500</td>
<td>服务器内部错误</td>
<td>Responses</td>
</tr>
<tr>
<td>503</td>
<td>Hystrix异常</td>
<td>Responses</td>
</tr>
<tr>
<td>## update</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p><strong>接口描述</strong>:</p>
<p><strong>接口地址</strong>:<code>/update</code></p>
<p><strong>请求方式</strong>：<code>GET</code></p>
<p><strong>consumes</strong>:``</p>
<p><strong>produces</strong>:<code>[&quot;*/*&quot;]</code></p>
<p><strong>请求参数</strong>：</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>in</th>
<th>是否必须</th>
<th>数据类型</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>uid</td>
<td>uid</td>
<td>query</td>
<td>true</td>
<td>integer</td>
<td></td>
</tr>
<tr>
<td>headImg</td>
<td>headImg</td>
<td>query</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>system OS</td>
<td>系统类型</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>token</td>
<td>登陆获取令牌</td>
<td>header</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
<tr>
<td>userName</td>
<td>userName</td>
<td>query</td>
<td>false</td>
<td>string</td>
<td></td>
</tr>
</tbody></table>
<p><strong>404响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>404响应参数</strong>:</p>
<p>暂无</p>
<p><strong>409响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>409响应参数</strong>:</p>
<p>暂无</p>
<p><strong>422响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>422响应参数</strong>:</p>
<p>暂无</p>
<p><strong>500响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>500响应参数</strong>:</p>
<p>暂无</p>
<p><strong>503响应示例</strong>:</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs json"><br><br></code></pre></td></tr></table></figure>

<p><strong>503响应参数</strong>:</p>
<p>暂无</p>
<p><strong>响应状态</strong>:</p>
<table>
<thead>
<tr>
<th>状态码</th>
<th>说明</th>
<th>schema</th>
</tr>
</thead>
<tbody><tr>
<td>200</td>
<td>OK</td>
<td></td>
</tr>
<tr>
<td>404</td>
<td>找不到资源</td>
<td>Responses</td>
</tr>
<tr>
<td>409</td>
<td>业务逻辑异常</td>
<td>Responses</td>
</tr>
<tr>
<td>422</td>
<td>参数校验异常</td>
<td>Responses</td>
</tr>
<tr>
<td>500</td>
<td>服务器内部错误</td>
<td>Responses</td>
</tr>
<tr>
<td>503</td>
<td>Hystrix异常</td>
<td>Responses</td>
</tr>
</tbody></table>

      </section>

      <section class="article-footer">
        
      </section>

      <section class="article-navs">
        
<nav class="card-container card-article-nav">
  <div class="card-wrap">
    
      <div id="article-nav-newer" class="card-item">
        <article>
          
          <a class="card-link article-nav-link" href="/2020/07/20/%E6%88%91%E7%9A%84%E7%82%92%E8%82%A1%E6%88%90%E7%A5%9E%E4%B9%8B%E8%B7%AF/"></a>
          <strong class="article-nav-caption">Newer</strong>
          <p class="article-nav-title">
            
              我的炒股成神之路
            
          </p>
        </article>
      </div>
    
    
  </div>
</nav>

      </section>

      

  
  
  <div class="valine-container">
    <div id="valine_thread" class="valine-thread"></div>
  </div>
  

  
  


    </div>
  </article>
</div>

    <!-- footer container -->
<footer id="footer" class="footer">
  <div class="footer-container">
     
    <p>&copy; 2022 <a href="/" target="_blank">Jan.</a></p>

    
      <p id="hitokoto"></p>
      <script src="https://v1.hitokoto.cn/?c=a&amp;encode=js&select=%23hitokoto" defer></script>
    

    

    <p>Powered by <a href="https://hexo.io" target="_blank" rel="noopener noreferrer">Hexo</a> Theme - <a href="https://github.com/miiiku/flex-block" target="_blank" rel="noopener noreferrer author">flex-block</a></p>
  </div>
</footer>
  </div>

  <div class="back-to-top-fixed">
    <svg class="icon icon-back-to-top" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
  <path d="M725.333333 426.666667c-12.8 0-21.333333-4.266667-29.866667-12.8l-213.333333-213.333333c-17.066667-17.066667-17.066667-42.666667 0-59.733333s42.666667-17.066667 59.733333 0l213.333333 213.333333c17.066667 17.066667 17.066667 42.666667 0 59.733333C746.666667 422.4 738.133333 426.666667 725.333333 426.666667z"></path>
  <path d="M298.666667 426.666667c-12.8 0-21.333333-4.266667-29.866667-12.8-17.066667-17.066667-17.066667-42.666667 0-59.733333l213.333333-213.333333c17.066667-17.066667 42.666667-17.066667 59.733333 0s17.066667 42.666667 0 59.733333l-213.333333 213.333333C320 422.4 311.466667 426.666667 298.666667 426.666667z"></path>
  <path d="M512 896c-25.6 0-42.666667-17.066667-42.666667-42.666667L469.333333 170.666667c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667l0 682.666667C554.666667 878.933333 537.6 896 512 896z"></path>
</svg> 
  </div>

  
  
<!-- valine 评论 start -->
<script type="text/javascript" src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script type="text/javascript" src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script type="text/javascript">
  new Valine({
    el: "#valine_thread",
    appId: "3rIYoHvYlHGJQdCNhr76Jgdm-gzGzoHsz",
    appKey: "AGUSQ1KmmjYBN1N3QMLL7UUS",
    avatar: "jan",
    placeholder: "随便说点什么叭～",
    notify: true,
    visitor: true,
    pageSize: 10,
  });
</script>
<!-- valine 评论 end -->



  <!-- aplayer 音频 start -->
  <link rel="stylesheet" href="https://unpkg.com/aplayer@1.10.1/dist/APlayer.min.css">
  <script type="text/javascript" src="https://unpkg.com/aplayer@1.10.1/dist/APlayer.min.js"></script>
  <script type="text/javascript">
    const aplayer = document.querySelectorAll(".aplayer");
    aplayer && initaplayer(aplayer);
    function initaplayer(els) {
      let elsArr = Array.from(els);
      elsArr.forEach(el => {
        new APlayer({
          container: el,
          audio: { ...el.dataset },
          theme: "#b7daff",
          lrcType: 3,
          autoplay: false,
          loop: false,
          mutex: true,
        });
      });
    }
  </script>
  <!-- aplayer 音频 end -->
  

<!-- dplayer 视频 start -->
<script type="text/javascript" src="https://unpkg.com/dplayer@1.25.1/dist/DPlayer.min.js"></script>
<script type="text/javascript">
  const dplayer = document.querySelectorAll(".dplayer");
  dplayer && initDPlayer(dplayer);
  function initDPlayer(els) {
    let elsArr = Array.from(els);
    elsArr.forEach(el => {
      let url = el.dataset.url;
      let cover = el.dataset.cover;
      let subtitle = el.dataset.subtitle;

      let options = {
        container: el,
        video: { url: url, pic: cover },
        theme: "#b7daff",
        autoplay: false,
        loop: false,
        mutex: true,
      }

      if (subtitle) {
        options.subtitle = {
          url: el.dataset.subtitle,
        }
      }
      new DPlayer(options);
    });
  }
</script>
<!-- dplayer 视频 end -->


<!-- waterfall 瀑布流 start -->

<script src="/lib/waterfall.min.js"></script>

<script type="text/javascript">

const waterfalls = document.querySelectorAll(".waterfall-container");

if (waterfalls && waterfalls.length > 0) {
  waterfalls.forEach((waterfall, index) => {
    let cls = "waterfall-container-" + index;
    waterfall.classList.add(cls);
    initWaterfall(cls, waterfall);
  });
}

function initWaterfall(selector, el) {
  const options = {};
  if (Object.keys(el.dataset).length > 0) {
    for (let k in el.dataset) {
      options[k] = el.dataset[k];
    }
  }
  waterfall(`.${selector}`, options);
}
</script>
<!-- waterfall 瀑布流 end -->


  <!-- zoom start -->
  
<script src="/lib/zoom.min.js"></script>

  <script type="text/javascript">
    document.querySelector(".article-content") && zoom(".article-content");
  </script>
  <!-- zoom end -->
  



  


  


  




<script src="/js/script.js"></script>

  
  <!-- 尾部用户自定义相关内容 -->

</body>
</html>